import request from '@/utils/request'

// 查询任务列表
export function todoList(query) {
  return request({
    url: '/flowable/task/todoList',
    method: 'get',
    params: query
  })
}

// 查询任务详细
export function getTask(taskId) {
  return request({
    url: '/flowable/task/' + taskId,
    method: 'get'
  })
}


// 删除任务
export function delTask(taskId) {
  return request({
    url: '/flowable/task/' + taskId,
    method: 'delete'
  })
}


// 任务流转记录
export function taskRecord(procInstId) {
  return request({
    url: '/flowable/task/taskRecord/' + procInstId,
    method: 'get',
  })
}

// 同意
export function completeTask(data) {
  return request({
    url: '/flowable/task/complete',
    method: 'post',
    data: data
  })
}

// 驳回
export function rejectTask(data) {
  return request({
    url: '/flowable/task/reject',
    method: 'post',
    data: data
  })
}


// 终止
export function stopProcess(data) {
  return request({
    url: '/flowable/task/stopProcess',
    method: 'post',
    data: data
  })
}

// 查询已处理列表
export function finishList(query) {
  return request({
    url: '/flowable/task/finishList',
    method: 'get',
    params: query
  })
}